from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.edge.options import Options
from Page import Page    ##导入Page
from Page3 import Page3  #导入Page3
import unittest,time

#定一个类
class TestCase(unittest.TestCase):
    def setUp(self):
        edge_options = Options()
        edge_options.add_argument("--headless")
        self.driver = webdriver.Edge(options=edge_options)
        self.driver.maximize_window()
    def tearDown(self):
        time.sleep(10)
        self.driver.quit()


    #调用登录业务
    def test_login_01(self):
        po = Page(self.driver)
        po.luoji_a3mall()

    #基于登录，调用添加收货地址
    def test_address_03(self):
        po = Page(self.driver)
        po.luoji_a3mall()
        po = Page3(self.driver)
        #实现业务
        po.dizhi()
        time.sleep(2)
        po.add()
        time.sleep(2)
        po.suozaidiqu()
        time.sleep(2)
        po.shouhuoren()
        time.sleep(2)
        po.phone()
        time.sleep(2)
        po.jiedao()
        time.sleep(2)
        po.tijiao()
        time.sleep(5)